# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=deepin-metacity
pkgver=3.22.24
pkgrel=3
pkgdesc="2D window manager for Deepin"
arch=('loong64' 'x86_64')
license=('GPL')
groups=('deepin')
depends=('dconf' 'libcanberra' 'libgtop' 'libsm' 'deepin-desktop-schemas' 'gtk3' 'startup-notification' 'zenity' 'bamf')
makedepends=('intltool' 'itstool' 'autoconf-archive' 'yelp-tools' 'python')
url="https://github.com/linuxdeepin/deepin-metacity"
source=("$pkgname-$pkgver.tar.gz::https://github.com/linuxdeepin/deepin-metacity/archive/$pkgver.tar.gz")
sha512sums=('dd92cb7fc169483d736abab78a9a7bf7261afba7d15aeab96775a7b67c745dc69f3b28931e7e2eb236a8f01507fa7cf5b30c139a509e36c71f8c666d93ef155f')

prepare() {
  cd $pkgname-$pkgver
  ./autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libexecdir=/usr/lib/$pkgname \
               --disable-static --disable-schemas-compile
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool  

  sed -i 's|/usr/share/backgrounds/default_background.jpg|/usr/share/backgrounds/deepin/desktop.jpg|' src/ui/*.c
}

build() {
  cd $pkgname-$pkgver
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
}
